/*
 * Checker.h
 *
 *  Created on: 19.10.2012
 *      Author: ddreval
 */

#ifndef CHECKER_H_
#define CHECKER_H_

#include <FBase.h>
#include <FNet.h>

class Checker :
	public Osp::Base::Runtime::Thread,
	public Osp::Net::Http::IHttpTransactionEventListener

  {

	public:
		Checker();
		Checker(Osp::Net::Http::HttpSession* session, Osp::Base::String hostAddr);
		virtual ~Checker();
	public:
		virtual void OnTransactionAborted (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction, result r);
		virtual void OnTransactionCertVerificationRequiredN (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction, Osp::Base::String *pCert);
		virtual void OnTransactionCompleted (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction);
		virtual void OnTransactionHeaderCompleted (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction, int headerLen, bool bAuthRequired);
		virtual void OnTransactionReadyToRead (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction, int availableBodyLen);
		virtual void OnTransactionReadyToWrite (Osp::Net::Http::HttpSession &httpSession, Osp::Net::Http::HttpTransaction &httpTransaction, int recommendedChunkSize);
	public:
		result Construct(void);
		virtual bool OnStart(void);
		virtual void OnStop(void);
		virtual void OnUserEventReceivedN(RequestId requestId, Osp::Base::Collection::IList *pArgs);
	private:
		Osp::Net::Http::HttpSession* session;
		Osp::Base::String hostAddr;


};

#endif /* CHECKER_H_ */
